home *** CD-ROM | disk | FTP | other *** search
-
- /* -------------------------------------------------------------------- */
- /* Listing 1 - declarations */
-
- /* structure for function table */
- struct func_list {
- char *funcname; /* pointer to function's name */
- struct param *(*func)(); /* pointer to function */
- } ;
-
- /* structure to hold parameter & return values */
- struct param {
- int datatype;
- union {
- char cparam;
- char *sparam;
- int iparam;
- long lparam;
- float fparam;
- /* other types could be added */
- } value;
- } ;
-
- /* data types */
- #define CHAR 1
- #define STRING 2
- #define INTEGER 3
- /* etc. */
-
- /* function prototypes */
- /* to call user function */
- struct param *call_ufunc(char *ufuncname,struct param args[],int num_args);
- /* to search function table */
- struct param *(*lookup(char *funcname, struct func_list functab[]))();
-
- /* user function prototypes */
- struct param *myfunc(struct param *sparm);
-
-